package net.metashare.grah.logic

import net.metashare.grah.Edge

/**
 * Grah is a notion produced by metashare.net
 * User: dsherema
 * Date: May 1, 2010
 * Time: 6:58:55 PM
 *
 */
class EdgePredicate implements Predicate {
  def Predicate tailPredicate
  def Predicate headPredicate
  def Predicate userPredicate



  def EdgePredicate(tailPredicate = True.instance, headPredicate = True.instance, userPredicate = True.instance) {
    this.tailPredicate = tailPredicate;
    this.headPredicate = headPredicate;
    this.userPredicate = userPredicate;
  }


  def boolean apply(Object object) {
    Edge edge = object
    return tailPredicate.apply(edge.getTail())
    headPredicate.apply(edge.getHead())
    userPredicate.apply(edge.getUser())

  }
}
